package com.kly.sc.api.application.controller.order.request;

import com.fqgj.common.api.ParamsObject;
import com.kly.sc.api.infras.exception.ApplicationException;
import com.kly.sc.api.infras.utils.StringUtils;
import lombok.Data;

@Data
public class OrderEventRequest extends ParamsObject {

    private String eventId;

    private String userCode;

    private String productCode;

    private String orderNo;

    private String orderId;

    private String eventCode;

    private String eventName;

    private String snapshotContent;


    @Override
    public void validate() {
        if (StringUtils.isEmpty(this.eventId)) {
            throw new ApplicationException("Parameter [eventId] should not be empty");
        }
        if (StringUtils.isEmpty(this.userCode)) {
            throw new ApplicationException("Parameter [userCode] should not be empty");
        }
        if (StringUtils.isEmpty(this.eventCode)) {
            throw new ApplicationException("Parameter [eventCode] should not be empty");
        }
        if (StringUtils.isEmpty(this.eventName)) {
            throw new ApplicationException("Parameter [eventName] should not be empty");
        }
//        if (StringUtils.isEmpty(this.snapshotContent)) {
//            throw new ApplicationException("Parameter [snapshotContent] should not be empty");
//        }
    }
}
